

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<link type="text/css" rel="stylesheet" href="${createLinkTo(dir:'css/csslxh',file:'lxh.css')}">
	<script type="text/javascript" src="${createLinkTo(dir:'FCKeditor',file:'fckeditor.js')}"></script>
	<title>Edit Cookbook</title>
</head>

<style>
	.tableGray td { height:26px } 
</style>

<script language="javascript">
function trim(str)
{
	return str.replace(/(^\s*)|(\s*$)/g, "");
}
function doCheck()
{
	if(trim(document.getElementById("cookName").value) == '')
	{
    	alert('菜名不能为空');
    	return false;		
	}
	if(trim(document.getElementById("ordernum").value) == '')
	{
    	alert('序号不能为空');
    	return false;		
	}
    var oEditor = FCKeditorAPI.GetInstance("content");  
    if( trim(oEditor.EditorDocument.body.innerText) == '' )
    {
    	alert('菜的做法不能为空');
    	return false;
    }
}
</script>

<body style="margin:0; overflow:auto">

<table width="100%" height="23" border="0" cellpadding="0" cellspacing="0" background="${createLinkTo(dir:'imagesmain',file:'grayListBg.gif')}">
  <tr>       
	<td width="50%" style="padding-top:2px;padding-left:10px;padding-right:15px" nowrap>
		<img src="${createLinkTo(dir:'imageslxh',file:'post.gif')}">
		<g:message code="lxh.func.edit"/><g:message code="lxh.display.detailName"/>
	</td>
	<td>&nbsp;</td>		
  </tr>  
</table>

<g:if test="${flash.message}">
	<div class="message">${flash.message}</div>
</g:if>

<g:hasErrors bean="${cookbookInstance}">
	<div class="errors">
		<g:renderErrors bean="${cookbookInstance}" as="list" />
	</div>
</g:hasErrors>

<g:form action="update" method="post" style="display:inline" >
	<input type="hidden" name="id" value="${cookbookInstance?.id}" />
	<input type="hidden" name="version" value="${cookbookInstance?.version}" />
	
	<table align="center" class="tableGray" cellpadding="0" cellspacing="1" style="margin-top:5px;">
	
	    <tr>
	    	<td width="20%" align="right" bgcolor="#f6f6f6">
	        	<label for="cookName"><g:message code="Cookbook.cookName"/>:&nbsp;</label>
	        </td>
	        <td class="value ${hasErrors(bean:cookbookInstance,field:'cookName','errors')}">
	        	<input type="text" maxlength="50" id="cookName" name="cookName" value="${fieldValue(bean:cookbookInstance,field:'cookName')}" class="textccc" />
	        </td>
	    </tr> 
	    	
	    <tr>
	    	<td align="right" bgcolor="#f6f6f6">
	        	<label for="cookType"><g:message code="Cookbook.cookType"/>:&nbsp;</label>
	        </td>
	        <td class="value ${hasErrors(bean:cookbookInstance,field:'cookType','errors')}">
	        	<g:select id="cookType" name="cookType" from="${cookbookInstance.constraints.cookType.inList}" value="${cookbookInstance.cookType}" ></g:select>
	        </td>
	    </tr> 
	    	
	    <tr>
	    	<td align="right" bgcolor="#f6f6f6">
	        	<label for="memo"><g:message code="Cookbook.memo"/>:&nbsp;</label>
	        </td>
	        <td class="value ${hasErrors(bean:cookbookInstance,field:'memo','errors')}">
	        	<input type="text" size="50" maxlength="100" id="memo" name="memo" value="${fieldValue(bean:cookbookInstance,field:'memo')}" class="textccc" />
	        </td>
	    </tr> 
	    	
	    <tr>
	    	<td align="right" bgcolor="#f6f6f6">
	        	<label for="ordernum"><g:message code="Cookbook.ordernum"/>:&nbsp;</label>
	        </td>
	        <td class="value ${hasErrors(bean:cookbookInstance,field:'ordernum','errors')}">
	        	<input type="text" size="10" id="ordernum" name="ordernum" value="${fieldValue(bean:cookbookInstance,field:'ordernum')}" class="textccc" />
	        </td>
	    </tr> 
	    	
	    <tr>
			<td align="right" bgcolor="#f6f6f6">
		    	<label for="ordernum">做法:&nbsp;</label>
		    </td>
		    <td>
		    	<textarea id="content" name="content" style="WIDTH: 80%; HEIGHT: 250px">${fieldValue(bean:cookbookInstance,field:'content')}</textarea>
					<script type="text/javascript">
					var oFCKeditor = new FCKeditor('content') ;
					oFCKeditor.BasePath = "../../FCKeditor/" ;
					oFCKeditor.Height = 250;
					oFCKeditor.ToolbarSet = "Lxhbar" ; //Default, Basic 
					oFCKeditor.ReplaceTextarea();
					</script> 		                                    
			</td>
	    </tr>         

	    <tr>
	    	<td align="center"  colspan="2" style="height:30">
	    		<input type="submit" value="<g:message code='lxh.btn.update'/>" class="btnGray">&nbsp;
	    		<input type="button" value="<g:message code='lxh.btn.cancel'/>" class="btnGray" onclick="history.back()">
	    	</td>
	    </tr>
	    
	</table>
	
</g:form>

                  

</body>
</html>
